<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trinamic TMC26X Stepper Driver for Arduino: TMC26XStepper Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Trinamic TMC26X Stepper Driver for Arduino
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">TMC26XStepper Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="TMC26XStepper" -->
<p>Class representing a TMC26X stepper driver.  
 <a href="class_t_m_c26_x_stepper.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>&gt;</code></p>

<p><a href="class_t_m_c26_x_stepper-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper</a> (int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=150)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">creates a new represenatation of a stepper motor connected to a TMC26X stepper driver  <a href="#a3ef40763b8b8ab2b6ed4978c0647906c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">start</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode.  <a href="#aad1ed82b3e05940bde5a6c7ed3d3e8f7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">un_start</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">resets the stepper in unconfigured mode.  <a href="#af968e70a13068f1e71ac0fa6865630c5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">setSpeed</a> (unsigned int whatSpeed)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the rotation speed in revolutions per minute.  <a href="#a9478f43090995c8d5cdb4d4e8c07cdbd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">getSpeed</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">reads out the currently selected speed in revolutions per minute.  <a href="#aa564f5cc0218d30ef897c2830c768c29"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">setMicrosteps</a> (int number_of_steps)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the number of microsteps in 2^i values (rounded) up to 256.  <a href="#a21041579c7f9284567ee2e2a55a3afd0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">getMicrosteps</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the effective current number of microsteps selected.  <a href="#a5808551ced98b79c09bbb4bf47ecfec3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">step</a> (int number_of_steps)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in the other direction.  <a href="#ac073a742496885f1f60751f9fb9c395d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">move</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Central movement method, must be called as often as possible in the lopp function and is very fast.  <a href="#aed5d81f1549615529c723600a68ba415"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">isMoving</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if the motor still has to move to fulfill the last movement command.  <a href="#a880d602be8414b7b965287c1790cd50e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">getStepsLeft</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of steps left in the current movement.  <a href="#aa6c3211f85301ca0fb2e7b73cb8142a7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">stop</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the motor regardless if it moves or not.  <a href="#a6315c18eadbc6bf4f3d81a6f80296123"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">setConstantOffTimeChopper</a> (char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets and configure the classical Constant Off Timer Chopper.  <a href="#ac2d8a2bbae2aba3ed7c98e3ff1a06649"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">setSpreadCycleChopper</a> (char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets and configures with spread cycle chopper.  <a href="#aa152bb7ddb72a2bc8465553a39232df2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">setRandomOffTime</a> (char value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Use random off time for noise reduction (0 for off, -1 for on).  <a href="#a7ffd602cf4bf385847cba034417d5f0a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">setCurrent</a> (unsigned int current)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller by employing CoolStep.  <a href="#aaa35fac83417c16b3a941fa168e4a4d2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">getCurrent</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a>  <a href="#a0c544e23efe3e4a912aacf57de84b71f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">setStallGuardThreshold</a> (char stall_guard_threshold, char stall_guard_filter_enabled)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">set the StallGuard threshold in order to get sensible StallGuard readings.  <a href="#af1a5abc23757860baf8ff421689a425a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">getStallGuardThreshold</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">reads out the StallGuard threshold  <a href="#a056661f444725c3ae15696d1e8d91def"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">getStallGuardFilter</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the current setting of the StallGuard filter  <a href="#a47e3443e3e786314c1099b8f14a91b8a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">setCoolStepConfiguration</a> (unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size, unsigned char current_increment_step_size, unsigned char lower_current_limit)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature.  <a href="#a381fbcce7c586ca2f1da8f9e704df14e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">setCoolStepEnabled</a> (boolean enabled)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it.  <a href="#a15bf0ed5a166a5d9a41f90f3ccbc6157"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">isCoolStepEnabled</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">check if the CoolStep feature is enabled  <a href="#a6de2306b6d8dc1fa2e50fccb66d8e66d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">getCoolStepLowerSgThreshold</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the lower StallGuard threshold for the CoolStep operation  <a href="#aa7469949deaa39a58038b3ddef532bc8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">getCoolStepUpperSgThreshold</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the upper StallGuard threshold for the CoolStep operation  <a href="#ac61298fd658773c28823d33ab04e970f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">getCoolStepNumberOfSGReadings</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the number of StallGuard readings befor CoolStep adjusts the motor current.  <a href="#aad44ee5ae73bf8e69af05674a304ba46"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">getCoolStepCurrentIncrementSize</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the increment steps for the current for the CoolStep operation  <a href="#ababe688a15f087d23d4ff2094fcee883"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">getCoolStepLowerCurrentLimit</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the absolut minium current for the CoolStep operation  <a href="#a0c7e8541abc120a3910e35c6fbf2167c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">getMotorPosition</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current microstep position for phase A.  <a href="#a1019f6f889acfd3176eecd60a0a20125"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">getCurrentStallGuardReading</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current StallGuard value.  <a href="#aed570ce3eea640e087b046333015de1e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">getCurrentCSReading</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current current setting value as fraction of the maximum current Returns values between 0 and 31, representing 1/32 to 32/32 (=1)  <a href="#a1a939fb495d747c2c11be99a740371e1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">isCurrentScalingHalfed</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.  <a href="#ad435db189ebb101fb2de90a484f33905"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">getCurrentCurrent</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000). This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it may not be the fastest.  <a href="#aa00741168a7def0a7a9d2f2c9d3b99d7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">isStallGuardOverThreshold</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if there is a StallGuard warning in the last status  <a href="#aea4c6e1fac909116c6b55f902d6cff41"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">getOverTemperature</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return over temperature status of the last status readout return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout.  <a href="#a7662c2fbc03d1f5a7da5cabcc153b2d7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">isShortToGroundA</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is motor channel A shorted to ground detected in the last status readout.  <a href="#ad329fa4693d3139dea241ebe3d0f33cf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">isShortToGroundB</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is motor channel B shorted to ground detected in the last status readout.  <a href="#a0ccb54d40cce0d802aa56ff6261f9f3b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">isOpenLoadA</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">iIs motor channel A connected according to the last statu readout.  <a href="#af97b2ab9d1ba36765ac6f17cf25ec45c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">isOpenLoadB</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">iIs motor channel A connected according to the last statu readout.  <a href="#a303590124f5ac6d6a06d0ec60d0b5303"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">isStandStill</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s.  <a href="#ab26602f360a4fb6ec6d262011675b2b0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">isStallGuardReached</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if there is a StallGuard warning in the last status  <a href="#afdeded501ec2cabeffde33d31b6573f7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">setEnabled</a> (boolean enabled)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.  <a href="#a4472cd86ad5b65dec5ec45ce69158305"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">isEnabled</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely  <a href="#a15796c0cbdeab23a343c3f25327283b6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">readStatus</a> (char read_value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Manually read out the status register This function sends a byte to the motor driver in order to get the current readout. The parameter read_value seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method may take time to send and read one or two bits - depending on the previous readout.  <a href="#af95a824bfdf49ef979b5354798e52967"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">getResistor</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150.  <a href="#ae1db5ec2ec9bfbfaea83c659e006692e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">debugLastStatus</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints out all the information that can be found in the last status read out - it does not force a status readout. The result is printed via Serial.  <a href="#ad5e5b1bf5a46d02577dd548083877ec3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">version</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">library version  <a href="#ab040d9df1e85d6fb0c105205a36b0215"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Class representing a TMC26X stepper driver. </p>
<p>In order to use one fo those drivers in your Arduino code you have to create an object of that class: </p>
<div class="fragment"><pre class="fragment"> <a class="code" href="class_t_m_c26_x_stepper.html" title="Class representing a TMC26X stepper driver.">TMC26XStepper</a> stepper = <a class="code" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c" title="creates a new represenatation of a stepper motor connected to a TMC26X stepper driver">TMC26XStepper</a>(200,1,2,3,500);
</pre></div><p> see TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int rms_current)</p>
<p>Keep in mind that you need to start the driver with <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">start()</a> in order to get the TMC26X configured.</p>
<p>The most important function is the <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a>. It checks if the motor has to do a step or not. It is important that you call <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a> as often as possible in your Arduino loop() routine. I suggest to use a very fast loop routine and always call it at the beginning or the end.</p>
<p>In order to move you have to provide a movement speed with <a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">setSpeed()</a>. The speed is a positive value setting the rotations per minute.</p>
<p>To really move the motor you have to call <a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a> to tell the driver to move the motor the given number of steps in the given direction. Positive values move the motor in one direction, negative values in the other direction.</p>
<p>You can check with <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> if the mototr is still moving or stop it apruptely with <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a>. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8h_source.html#l00101">101</a> of file <a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3ef40763b8b8ab2b6ed4978c0647906c"></a><!-- doxytag: member="TMC26XStepper::TMC26XStepper" ref="a3ef40763b8b8ab2b6ed4978c0647906c" args="(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=150)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_m_c26_x_stepper.html#a3ef40763b8b8ab2b6ed4978c0647906c">TMC26XStepper::TMC26XStepper</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>number_of_steps</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cs_pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dir_pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>step_pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>current</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>resistor</em> = <code>150</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>creates a new represenatation of a stepper motor connected to a TMC26X stepper driver </p>
<p>This is the main constructor. If in doubt use this. You must provide all parameters as described below.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">number_of_steps</td><td>the number of steps the motor has per rotation. </td></tr>
    <tr><td class="paramname">cs_pin</td><td>The Arduino pin you have connected the Cient Select Pin (!CS) of the TMC26X for SPI </td></tr>
    <tr><td class="paramname">dir_pin</td><td>the number of the Arduino pin the Direction input of the TMC26X is connected </td></tr>
    <tr><td class="paramname">step_pin</td><td>the number of the Arduino pin the step pin of the TMC26X driver is connected. </td></tr>
    <tr><td class="paramname">rms_current</td><td>the maximum current to privide to the motor in mA (!). A value of 200 would send up to 200mA to the motor </td></tr>
    <tr><td class="paramname">resistor</td><td>the current sense resistor in milli Ohm, defaults to ,15 Ohm ( or 150 milli Ohm) as in the TMC260 Arduino Shield</td></tr>
  </table>
  </dd>
</dl>
<p>Keep in mind that you must also call <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">TMC26XStepper.start()</a> in order to configure the stepper driver for use.</p>
<p>By default the Constant Off Time chopper is used, see TCM262Stepper.setConstantOffTimeChopper() for details. This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper, see <a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2" title="Sets and configures with spread cycle chopper.">setSpreadCycleChopper()</a>.</p>
<p>By default a microstepping of 1/32th is used to provide a smooth motor run, while still giving a good progression per step. You can select a different stepping with <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> to aa different value. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7" title="configures and starts the TMC26X stepper driver. Before you called this function the stepper driver i...">start()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00111">111</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad5e5b1bf5a46d02577dd548083877ec3"></a><!-- doxytag: member="TMC26XStepper::debugLastStatus" ref="ad5e5b1bf5a46d02577dd548083877ec3" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#ad5e5b1bf5a46d02577dd548083877ec3">TMC26XStepper::debugLastStatus</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Prints out all the information that can be found in the last status read out - it does not force a status readout. The result is printed via Serial. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00902">902</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ababe688a15f087d23d4ff2094fcee883"></a><!-- doxytag: member="TMC26XStepper::getCoolStepCurrentIncrementSize" ref="ababe688a15f087d23d4ff2094fcee883" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#ababe688a15f087d23d4ff2094fcee883">TMC26XStepper::getCoolStepCurrentIncrementSize</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>returns the increment steps for the current for the CoolStep operation </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00704">704</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a0c7e8541abc120a3910e35c6fbf2167c"></a><!-- doxytag: member="TMC26XStepper::getCoolStepLowerCurrentLimit" ref="a0c7e8541abc120a3910e35c6fbf2167c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#a0c7e8541abc120a3910e35c6fbf2167c">TMC26XStepper::getCoolStepLowerCurrentLimit</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>returns the absolut minium current for the CoolStep operation </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd>
<dd>
<a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">COOL_STEP_HALF_CS_LIMIT</a>, COOL_STEP_QUARTER_CS_LIMIT </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00712">712</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aa7469949deaa39a58038b3ddef532bc8"></a><!-- doxytag: member="TMC26XStepper::getCoolStepLowerSgThreshold" ref="aa7469949deaa39a58038b3ddef532bc8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa7469949deaa39a58038b3ddef532bc8">TMC26XStepper::getCoolStepLowerSgThreshold</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>returns the lower StallGuard threshold for the CoolStep operation </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00695">695</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aad44ee5ae73bf8e69af05674a304ba46"></a><!-- doxytag: member="TMC26XStepper::getCoolStepNumberOfSGReadings" ref="aad44ee5ae73bf8e69af05674a304ba46" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#aad44ee5ae73bf8e69af05674a304ba46">TMC26XStepper::getCoolStepNumberOfSGReadings</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>returns the number of StallGuard readings befor CoolStep adjusts the motor current. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00708">708</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac61298fd658773c28823d33ab04e970f"></a><!-- doxytag: member="TMC26XStepper::getCoolStepUpperSgThreshold" ref="ac61298fd658773c28823d33ab04e970f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#ac61298fd658773c28823d33ab04e970f">TMC26XStepper::getCoolStepUpperSgThreshold</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>returns the upper StallGuard threshold for the CoolStep operation </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00700">700</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a0c544e23efe3e4a912aacf57de84b71f"></a><!-- doxytag: member="TMC26XStepper::getCurrent" ref="a0c544e23efe3e4a912aacf57de84b71f" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f">TMC26XStepper::getCurrent</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the maximum motor current in milli amps </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00336">336</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a1a939fb495d747c2c11be99a740371e1"></a><!-- doxytag: member="TMC26XStepper::getCurrentCSReading" ref="a1a939fb495d747c2c11be99a740371e1" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char <a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1">TMC26XStepper::getCurrentCSReading</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reads the current current setting value as fraction of the maximum current Returns values between 0 and 31, representing 1/32 to 32/32 (=1) </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00781">781</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aa00741168a7def0a7a9d2f2c9d3b99d7"></a><!-- doxytag: member="TMC26XStepper::getCurrentCurrent" ref="aa00741168a7def0a7a9d2f2c9d3b99d7" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7">TMC26XStepper::getCurrentCurrent</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000). This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it may not be the fastest. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a1a939fb495d747c2c11be99a740371e1" title="Reads the current current setting value as fraction of the maximum current Returns values between 0 a...">getCurrentCSReading()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e" title="Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150...">getResistor()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905" title="a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.">isCurrentScalingHalfed()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f" title="readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()">getCurrent()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00792">792</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aed570ce3eea640e087b046333015de1e"></a><!-- doxytag: member="TMC26XStepper::getCurrentStallGuardReading" ref="aed570ce3eea640e087b046333015de1e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e">TMC26XStepper::getCurrentStallGuardReading</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reads the current StallGuard value. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The current StallGuard value, lesser values indicate higher load, 0 means stall detected. Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00770">770</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a5808551ced98b79c09bbb4bf47ecfec3"></a><!-- doxytag: member="TMC26XStepper::getMicrosteps" ref="a5808551ced98b79c09bbb4bf47ecfec3" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3">TMC26XStepper::getMicrosteps</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>returns the effective current number of microsteps selected. </p>
<p>This function always returns the effective number of microsteps. This can be a bit different than the micro steps set in <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> since it is rounded to 2^i.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0" title="Set the number of microsteps in 2^i values (rounded) up to 256.">setMicrosteps()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00446">446</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a1019f6f889acfd3176eecd60a0a20125"></a><!-- doxytag: member="TMC26XStepper::getMotorPosition" ref="a1019f6f889acfd3176eecd60a0a20125" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125">TMC26XStepper::getMotorPosition</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the current microstep position for phase A. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The current microstep position for phase A 0…255</dd></dl>
<p>Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00762">762</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a7662c2fbc03d1f5a7da5cabcc153b2d7"></a><!-- doxytag: member="TMC26XStepper::getOverTemperature" ref="a7662c2fbc03d1f5a7da5cabcc153b2d7" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a7662c2fbc03d1f5a7da5cabcc153b2d7">TMC26XStepper::getOverTemperature</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return over temperature status of the last status readout return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00816">816</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ae1db5ec2ec9bfbfaea83c659e006692e"></a><!-- doxytag: member="TMC26XStepper::getResistor" ref="ae1db5ec2ec9bfbfaea83c659e006692e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#ae1db5ec2ec9bfbfaea83c659e006692e">TMC26XStepper::getResistor</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the current sense resistor value in milliohm. The default value of ,15 Ohm will return 150. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00883">883</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aa564f5cc0218d30ef897c2830c768c29"></a><!-- doxytag: member="TMC26XStepper::getSpeed" ref="aa564f5cc0218d30ef897c2830c768c29" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa564f5cc0218d30ef897c2830c768c29">TMC26XStepper::getSpeed</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>reads out the currently selected speed in revolutions per minute. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd" title="Sets the rotation speed in revolutions per minute.">setSpeed()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00221">221</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a47e3443e3e786314c1099b8f14a91b8a"></a><!-- doxytag: member="TMC26XStepper::getStallGuardFilter" ref="a47e3443e3e786314c1099b8f14a91b8a" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a47e3443e3e786314c1099b8f14a91b8a">TMC26XStepper::getStallGuardFilter</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>returns the current setting of the StallGuard filter </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if not set, -1 if set </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00381">381</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a056661f444725c3ae15696d1e8d91def"></a><!-- doxytag: member="TMC26XStepper::getStallGuardThreshold" ref="a056661f444725c3ae15696d1e8d91def" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a056661f444725c3ae15696d1e8d91def">TMC26XStepper::getStallGuardThreshold</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>reads out the StallGuard threshold </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>a number between -64 and 63. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00368">368</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aa6c3211f85301ca0fb2e7b73cb8142a7"></a><!-- doxytag: member="TMC26XStepper::getStepsLeft" ref="aa6c3211f85301ca0fb2e7b73cb8142a7" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7">TMC26XStepper::getStepsLeft</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the number of steps left in the current movement. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of steps left in the movement. This number is always positive. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00278">278</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a6de2306b6d8dc1fa2e50fccb66d8e66d"></a><!-- doxytag: member="TMC26XStepper::isCoolStepEnabled" ref="a6de2306b6d8dc1fa2e50fccb66d8e66d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a6de2306b6d8dc1fa2e50fccb66d8e66d">TMC26XStepper::isCoolStepEnabled</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>check if the CoolStep feature is enabled </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157" title="enables or disables the CoolStep smart energy operation feature. It must be configured before enablin...">setCoolStepEnabled()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00691">691</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ad435db189ebb101fb2de90a484f33905"></a><!-- doxytag: member="TMC26XStepper::isCurrentScalingHalfed" ref="ad435db189ebb101fb2de90a484f33905" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ad435db189ebb101fb2de90a484f33905">TMC26XStepper::isCurrentScalingHalfed</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>false if 0.13V is the reference voltage, true if 0.165V is used. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00887">887</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a15796c0cbdeab23a343c3f25327283b6"></a><!-- doxytag: member="TMC26XStepper::isEnabled" ref="a15796c0cbdeab23a343c3f25327283b6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a15796c0cbdeab23a343c3f25327283b6">TMC26XStepper::isEnabled</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the bridges and by that the motor driver are enabled, false if not. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305" title="enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.">setEnabled()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00729">729</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a880d602be8414b7b965287c1790cd50e"></a><!-- doxytag: member="TMC26XStepper::isMoving" ref="a880d602be8414b7b965287c1790cd50e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e">TMC26XStepper::isMoving</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>checks if the motor still has to move to fulfill the last movement command. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the motor stops, -1 if the motor is moving.</dd></dl>
<p>This method can be used to determine if the motor is ready for new movements. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415" title="Central movement method, must be called as often as possible in the lopp function and is very fast...">move()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00274">274</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="af97b2ab9d1ba36765ac6f17cf25ec45c"></a><!-- doxytag: member="TMC26XStepper::isOpenLoadA" ref="af97b2ab9d1ba36765ac6f17cf25ec45c" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#af97b2ab9d1ba36765ac6f17cf25ec45c">TMC26XStepper::isOpenLoadA</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>iIs motor channel A connected according to the last statu readout. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00846">846</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a303590124f5ac6d6a06d0ec60d0b5303"></a><!-- doxytag: member="TMC26XStepper::isOpenLoadB" ref="a303590124f5ac6d6a06d0ec60d0b5303" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a303590124f5ac6d6a06d0ec60d0b5303">TMC26XStepper::isOpenLoadB</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>iIs motor channel A connected according to the last statu readout. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00854">854</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ad329fa4693d3139dea241ebe3d0f33cf"></a><!-- doxytag: member="TMC26XStepper::isShortToGroundA" ref="ad329fa4693d3139dea241ebe3d0f33cf" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ad329fa4693d3139dea241ebe3d0f33cf">TMC26XStepper::isShortToGroundA</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Is motor channel A shorted to ground detected in the last status readout. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00830">830</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a0ccb54d40cce0d802aa56ff6261f9f3b"></a><!-- doxytag: member="TMC26XStepper::isShortToGroundB" ref="a0ccb54d40cce0d802aa56ff6261f9f3b" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#a0ccb54d40cce0d802aa56ff6261f9f3b">TMC26XStepper::isShortToGroundB</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Is motor channel B shorted to ground detected in the last status readout. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00838">838</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aea4c6e1fac909116c6b55f902d6cff41"></a><!-- doxytag: member="TMC26XStepper::isStallGuardOverThreshold" ref="aea4c6e1fac909116c6b55f902d6cff41" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41">TMC26XStepper::isStallGuardOverThreshold</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>checks if there is a StallGuard warning in the last status </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if there was no warning, -1 if there was some warning. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00803">803</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="afdeded501ec2cabeffde33d31b6573f7"></a><!-- doxytag: member="TMC26XStepper::isStallGuardReached" ref="afdeded501ec2cabeffde33d31b6573f7" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#afdeded501ec2cabeffde33d31b6573f7">TMC26XStepper::isStallGuardReached</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>checks if there is a StallGuard warning in the last status </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if there was no warning, -1 if there was some warning. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aea4c6e1fac909116c6b55f902d6cff41" title="checks if there is a StallGuard warning in the last status">isStallGuardOverThreshold()</a> TODO why?</dd>
<dd>
<a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a" title="set the StallGuard threshold in order to get sensible StallGuard readings.">setStallGuardThreshold()</a> for tuning the readout to sensible ranges. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00870">870</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ab26602f360a4fb6ec6d262011675b2b0"></a><!-- doxytag: member="TMC26XStepper::isStandStill" ref="ab26602f360a4fb6ec6d262011675b2b0" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="class_t_m_c26_x_stepper.html#ab26602f360a4fb6ec6d262011675b2b0">TMC26XStepper::isStandStill</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true is yes, false if not. Keep in mind that this method does not enforce a readout but uses the value of the last status readout. You may want to use <a class="el" href="class_t_m_c26_x_stepper.html#a1019f6f889acfd3176eecd60a0a20125" title="Get the current microstep position for phase A.">getMotorPosition()</a> or <a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to enforce an updated status readout. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00862">862</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aed5d81f1549615529c723600a68ba415"></a><!-- doxytag: member="TMC26XStepper::move" ref="aed5d81f1549615529c723600a68ba415" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#aed5d81f1549615529c723600a68ba415">TMC26XStepper::move</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Central movement method, must be called as often as possible in the lopp function and is very fast. </p>
<p>This routine checks if the motor still has to move, if the waiting delay has passed to send a new step command to the motor and manages the number of steps yet to move to fulfill the current move command.</p>
<p>This function is implemented to be as fast as possible to call it as often as possible in your loop routine. The more regurlarly you call this function the better. In both senses of 'regularly': Calling it as often as possible is not a bad idea and if you even manage that the intervals you call this function are not too irregular helps too.</p>
<p>You can call this routine even if you know that the motor is not miving. It introduces just a very small penalty in your code. You must not call <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> to determine if you need to call this function, since taht is done internally already and only slows down you code.</p>
<p>How often you call this function directly influences your top miving speed for the motor. It may be a good idea to call this from an timer overflow interrupt to ensure proper calling. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d" title="Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in ...">step()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00246">246</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="af95a824bfdf49ef979b5354798e52967"></a><!-- doxytag: member="TMC26XStepper::readStatus" ref="af95a824bfdf49ef979b5354798e52967" args="(char read_value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af95a824bfdf49ef979b5354798e52967">TMC26XStepper::readStatus</a> </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>read_value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Manually read out the status register This function sends a byte to the motor driver in order to get the current readout. The parameter read_value seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method may take time to send and read one or two bits - depending on the previous readout. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">read_value</td><td>selects which value to read out (0..3). You can use the defines TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, or TMC_262_READOUT_CURRENT </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="_t_m_c26_x_stepper_8h.html#aff05d4a47ef8821322ccc2a20785fbee">TMC26X_READOUT_POSITION</a>, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00742">742</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac2d8a2bbae2aba3ed7c98e3ff1a06649"></a><!-- doxytag: member="TMC26XStepper::setConstantOffTimeChopper" ref="ac2d8a2bbae2aba3ed7c98e3ff1a06649" args="(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#ac2d8a2bbae2aba3ed7c98e3ff1a06649">TMC26XStepper::setConstantOffTimeChopper</a> </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>constant_off_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>blank_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>fast_decay_time_setting</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>sine_wave_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>use_current_comparator</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets and configure the classical Constant Off Timer Chopper. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">constant_off_time</td><td>The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) </td></tr>
    <tr><td class="paramname">blank_time</td><td>Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting </td></tr>
    <tr><td class="paramname">fast_decay_time_setting</td><td>Fast decay time setting. Controls the portion of fast decay for each chopper cycle. 0: slow decay only, 1…15: duration of fast decay phase </td></tr>
    <tr><td class="paramname">sine_wave_offset</td><td>Sine wave offset. Controls the sine wave offset. A positive offset corrects for zero crossing error. -3…-1: negative offset, 0: no offset,1…12: positive offset </td></tr>
    <tr><td class="paramname">use_curreent_comparator</td><td>Selects usage of the current comparator for termination of the fast decay cycle. If current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actual positive value. (0 disable, -1 enable).</td></tr>
  </table>
  </dd>
</dl>
<p>The classic constant off time chopper uses a fixed portion of fast decay following each on phase. While the duration of the on time is determined by the chopper comparator, the fast decay time needs to be set by the user in a way, that the current decay is enough for the driver to be able to follow the falling slope of the sine wave, and on the other hand it should not be too long, in order to minimize motor current ripple and power dissipation. This best can be tuned using an oscilloscope or trying out motor smoothness at different velocities. A good starting value is a fast decay time setting similar to the slow decay time setting. After tuning of the fast decay time, the offset should be determined, in order to have a smooth zero transition. This is necessary, because the fast decay phase leads to the absolute value of the motor current being lower than the target current (see figure 17). If the zero offset is too low, the motor stands still for a short moment during current zero crossing, if it is set too high, it makes a larger microstep. Typically, a positive offset setting is required for optimum operation.</p>
<dl class="see"><dt><b>See also:</b></dt><dd>setSpreadCycleChoper() for other alternatives. </dd>
<dd>
<a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a" title="Use random off time for noise reduction (0 for off, -1 for on).">setRandomOffTime()</a> for spreading the noise over a wider spectrum </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00473">473</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a381fbcce7c586ca2f1da8f9e704df14e"></a><!-- doxytag: member="TMC26XStepper::setCoolStepConfiguration" ref="a381fbcce7c586ca2f1da8f9e704df14e" args="(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size, unsigned char current_increment_step_size, unsigned char lower_current_limit)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e">TMC26XStepper::setCoolStepConfiguration</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>lower_SG_threshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>SG_hysteresis</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>current_decrement_step_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>current_increment_step_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>lower_current_limit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">lower_SG_threshold</td><td>Sets the lower threshold for stallGuard2TM reading. Below this value, the motor current becomes increased. Allowed values are 0...480 </td></tr>
    <tr><td class="paramname">SG_hysteresis</td><td>Sets the distance between the lower and the upper threshold for stallGuard2TM reading. Above the upper threshold (which is lower_SG_threshold+SG_hysteresis+1) the motor current becomes decreased. Allowed values are 0...480 </td></tr>
    <tr><td class="paramname">current_decrement_step_size</td><td>Sets the current decrement steps. If the StallGuard value is above the threshold the current gets decremented by this step size. 0...32 </td></tr>
    <tr><td class="paramname">current_increment_step_size</td><td>Sets the current increment step. The current becomes incremented for each measured stallGuard2TM value below the lower threshold. 0...8 </td></tr>
    <tr><td class="paramname">lower_current_limit</td><td>Sets the lower motor current limit for coolStepTM operation by scaling the CS value. Values can be COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load, read out by the StallGuard in order to provide the optimum torque with the minimal current consumption. You configure the CoolStep current regulator by defining upper and lower bounds of StallGuard readouts. If the readout is above the limit the current gets increased, below the limit the current gets decreased. You can specify the upper an lower threshold of the StallGuard readout in order to adjust the current. You can also set the number of StallGuard readings neccessary above or below the limit to get a more stable current adjustement. The current adjustement itself is configured by the number of steps the current gests in- or decreased and the absolut minimum current (1/2 or 1/4th otf the configured current). </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="_t_m_c26_x_stepper_8h.html#a28b1774bd4aa854fb5e4b6dc7db96ecb">COOL_STEP_HALF_CS_LIMIT</a>, COOL_STEP_QUARTER_CS_LIMIT </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00636">636</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a15bf0ed5a166a5d9a41f90f3ccbc6157"></a><!-- doxytag: member="TMC26XStepper::setCoolStepEnabled" ref="a15bf0ed5a166a5d9a41f90f3ccbc6157" args="(boolean enabled)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a15bf0ed5a166a5d9a41f90f3ccbc6157">TMC26XStepper::setCoolStepEnabled</a> </td>
          <td>(</td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>enabled</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">enabled</td><td>true if CoolStep should be enabled, false if not. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a381fbcce7c586ca2f1da8f9e704df14e" title="This method configures the CoolStep smart energy operation. You must have a proper StallGuard configu...">setCoolStepConfiguration()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00676">676</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aaa35fac83417c16b3a941fa168e4a4d2"></a><!-- doxytag: member="TMC26XStepper::setCurrent" ref="aaa35fac83417c16b3a941fa168e4a4d2" args="(unsigned int current)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aaa35fac83417c16b3a941fa168e4a4d2">TMC26XStepper::setCurrent</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>current</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>set the maximum motor current in mA (1000 is 1 Amp) Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller by employing CoolStep. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">current</td><td>the maximum motor current in mA </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a0c544e23efe3e4a912aacf57de84b71f" title="readout the motor maximum current in mA (1000 is an Amp) This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()">getCurrent()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aa00741168a7def0a7a9d2f2c9d3b99d7" title="Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000...">getCurrentCurrent()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00292">292</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a4472cd86ad5b65dec5ec45ce69158305"></a><!-- doxytag: member="TMC26XStepper::setEnabled" ref="a4472cd86ad5b65dec5ec45ce69158305" args="(boolean enabled)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a4472cd86ad5b65dec5ec45ce69158305">TMC26XStepper::setEnabled</a> </td>
          <td>(</td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>enabled</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">enabled</td><td>a boolean value true if the motor should be enabled, false otherwise. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00716">716</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a21041579c7f9284567ee2e2a55a3afd0"></a><!-- doxytag: member="TMC26XStepper::setMicrosteps" ref="a21041579c7f9284567ee2e2a55a3afd0" args="(int number_of_steps)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a21041579c7f9284567ee2e2a55a3afd0">TMC26XStepper::setMicrosteps</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>number_of_steps</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the number of microsteps in 2^i values (rounded) up to 256. </p>
<p>This method set's the number of microsteps per step in 2^i interval. This means you can select 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps. If you give any other value it will be rounded to the next smaller number (3 would give a microstepping of 2). You can always check the current microstepping with <a class="el" href="class_t_m_c26_x_stepper.html#a5808551ced98b79c09bbb4bf47ecfec3" title="returns the effective current number of microsteps selected.">getMicrosteps()</a>. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00394">394</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a7ffd602cf4bf385847cba034417d5f0a"></a><!-- doxytag: member="TMC26XStepper::setRandomOffTime" ref="a7ffd602cf4bf385847cba034417d5f0a" args="(char value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a">TMC26XStepper::setRandomOffTime</a> </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Use random off time for noise reduction (0 for off, -1 for on). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>0 for off, -1 for on</td></tr>
  </table>
  </dd>
</dl>
<p>In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, thus it depends on the microstep position. With some motors a slightly audible beat can occur between the chopper frequencies, especially when they are near to each other. This typically occurs at a few microstep positions within each quarter wave. This effect normally is not audible when compared to mechanical noise generated by ball bearings, etc. Further factors which can cause a similar effect are a poor layout of sense resistor GND connection. In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum, reducing electromagnetic emission on single frequencies. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00624">624</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a9478f43090995c8d5cdb4d4e8c07cdbd"></a><!-- doxytag: member="TMC26XStepper::setSpeed" ref="a9478f43090995c8d5cdb4d4e8c07cdbd" args="(unsigned int whatSpeed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#a9478f43090995c8d5cdb4d4e8c07cdbd">TMC26XStepper::setSpeed</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>whatSpeed</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the rotation speed in revolutions per minute. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">whatSpeed</td><td>the desired speed in rotations per minute. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00208">208</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aa152bb7ddb72a2bc8465553a39232df2"></a><!-- doxytag: member="TMC26XStepper::setSpreadCycleChopper" ref="aa152bb7ddb72a2bc8465553a39232df2" args="(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aa152bb7ddb72a2bc8465553a39232df2">TMC26XStepper::setSpreadCycleChopper</a> </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>constant_off_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>blank_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>hysteresis_start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>hysteresis_end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>hysteresis_decrement</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets and configures with spread cycle chopper. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">constant_off_time</td><td>The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks) </td></tr>
    <tr><td class="paramname">blank_time</td><td>Selects the comparator blank time. This time needs to safely cover the switching event and the duration of the ringing on the sense resistor. For most low current drivers, a setting of 1 or 2 is good. For high current applications with large MOSFETs, a setting of 2 or 3 will be required. 0 (min setting) … (3) amx setting </td></tr>
    <tr><td class="paramname">hysteresis_start</td><td>Hysteresis start setting. Please remark, that this value is an offset to the hysteresis end value. 1 … 8 </td></tr>
    <tr><td class="paramname">hysteresis_end</td><td>Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by hysteresis_decrement. The sum hysteresis_start + hysteresis_end must be &lt;16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited. </td></tr>
    <tr><td class="paramname">hysteresis_decrement</td><td>Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. 0 (fast decrement) … 3 (slow decrement).</td></tr>
  </table>
  </dd>
</dl>
<p>The spreadCycle chopper scheme (pat.fil.) is a precise and simple to use chopper principle, which automatically determines the optimum fast decay portion for the motor. Anyhow, a number of settings can be made in order to optimally fit the driver to the motor. Each chopper cycle is comprised of an on-phase, a slow decay phase, a fast decay phase and a second slow decay phase. The slow decay phases limit the maximum chopper frequency and are important for low motor and driver power dissipation. The hysteresis start setting limits the chopper frequency by forcing the driver to introduce a minimum amount of current ripple into the motor coils. The motor inductivity determines the ability to follow a changing motor current. The duration of the on- and fast decay phase needs to cover at least the blank time, because the current comparator is disabled during this time.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a7ffd602cf4bf385847cba034417d5f0a" title="Use random off time for noise reduction (0 for off, -1 for on).">setRandomOffTime()</a> for spreading the noise over a wider spectrum </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00552">552</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="af1a5abc23757860baf8ff421689a425a"></a><!-- doxytag: member="TMC26XStepper::setStallGuardThreshold" ref="af1a5abc23757860baf8ff421689a425a" args="(char stall_guard_threshold, char stall_guard_filter_enabled)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af1a5abc23757860baf8ff421689a425a">TMC26XStepper::setStallGuardThreshold</a> </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>stall_guard_threshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>stall_guard_filter_enabled</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>set the StallGuard threshold in order to get sensible StallGuard readings. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">stall_guard_threshold</td><td>-64 … 63 the StallGuard threshold </td></tr>
    <tr><td class="paramname">stall_guard_filter_enabled</td><td>0 if the filter is disabled, -1 if it is enabled</td></tr>
  </table>
  </dd>
</dl>
<p>The StallGuard threshold is used to optimize the StallGuard reading to sensible values. It should be at 0 at the maximum allowable load on the otor (but not before). = is a good starting point (and the default) If you get Stall Gaurd readings of 0 without any load or with too little laod increase the value. If you get readings of 1023 even with load decrease the setting.</p>
<p>If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the reading.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#aed570ce3eea640e087b046333015de1e" title="Reads the current StallGuard value.">getCurrentStallGuardReading()</a> to read out the current value. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00346">346</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aad1ed82b3e05940bde5a6c7ed3d3e8f7"></a><!-- doxytag: member="TMC26XStepper::start" ref="aad1ed82b3e05940bde5a6c7ed3d3e8f7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#aad1ed82b3e05940bde5a6c7ed3d3e8f7">TMC26XStepper::start</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode. </p>
<p>This routine configures the TMC26X stepper driver for the given values via SPI. Most member functions are non functional if the driver has not been started. Therefore it is best to call this in your Arduino setup() function. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00157">157</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac073a742496885f1f60751f9fb9c395d"></a><!-- doxytag: member="TMC26XStepper::step" ref="ac073a742496885f1f60751f9fb9c395d" args="(int number_of_steps)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#ac073a742496885f1f60751f9fb9c395d">TMC26XStepper::step</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>number_of_steps</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initiate a movement for the given number of steps. Positive numbers move in one, negative numbers in the other direction. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">number_of_steps</td><td>The number of steps to move the motor. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the motor was not moving and moves now. -1 if the motor is moving and the new steps could not be set.</dd></dl>
<p>If the previous movement is not finished yet the function will return -1 and not change the steps to move the motor. If the motor does not move it return 0</p>
<p>The direction of the movement is indicated by the sign of the steps parameter. It is not determinable if positive values are right or left This depends on the internal construction of the motor and how you connected it to the stepper driver.</p>
<p>You can always verify with <a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a> or even use <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a> to stop the motor before giving it new step directions. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_m_c26_x_stepper.html#a880d602be8414b7b965287c1790cd50e" title="checks if the motor still has to move to fulfill the last movement command.">isMoving()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#aa6c3211f85301ca0fb2e7b73cb8142a7" title="Get the number of steps left in the current movement.">getStepsLeft()</a>, <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123" title="Stops the motor regardless if it moves or not.">stop()</a> </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00229">229</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a6315c18eadbc6bf4f3d81a6f80296123"></a><!-- doxytag: member="TMC26XStepper::stop" ref="a6315c18eadbc6bf4f3d81a6f80296123" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char <a class="el" href="class_t_m_c26_x_stepper.html#a6315c18eadbc6bf4f3d81a6f80296123">TMC26XStepper::stop</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Stops the motor regardless if it moves or not. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>-1 if the motor was moving and is really stoped or 0 if it was not moving at all.</dd></dl>
<p>This method directly and apruptely stops the motor and may be used as an emergency stop. </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00282">282</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="af968e70a13068f1e71ac0fa6865630c5"></a><!-- doxytag: member="TMC26XStepper::un_start" ref="af968e70a13068f1e71ac0fa6865630c5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_t_m_c26_x_stepper.html#af968e70a13068f1e71ac0fa6865630c5">TMC26XStepper::un_start</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>resets the stepper in unconfigured mode. </p>
<p>This routine enables you to call start again. It does not change anything in the internal stepper configuration or the desired configuration. It just marks the stepper as not yet startet. You do not have to reconfigure the stepper to start it again, but it is not reset to any factory settings this has to be configured back by yourself. (Hint: Normally you do not need this function) </p>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00199">199</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ab040d9df1e85d6fb0c105205a36b0215"></a><!-- doxytag: member="TMC26XStepper::version" ref="ab040d9df1e85d6fb0c105205a36b0215" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_t_m_c26_x_stepper.html#ab040d9df1e85d6fb0c105205a36b0215">TMC26XStepper::version</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>library version </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the version number as int. </dd></dl>

<p>Definition at line <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html#l00897">897</a> of file <a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_t_m_c26_x_stepper_8h_source.html">TMC26XStepper.h</a></li>
<li><a class="el" href="_t_m_c26_x_stepper_8cpp_source.html">TMC26XStepper.cpp</a></li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 19 2012 20:26:21 for Trinamic TMC26X Stepper Driver for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
